// Function to load user data from localStorage
function loadUserData() {
  const userData = JSON.parse(localStorage.getItem("userData"));

  if (userData && userData.phone) {
    // Set the phone number or any other field (like userType) as the username
    document.getElementById("username").textContent = userData.phone || "默认用户名";
  } else {
    document.getElementById("username").textContent = "默认用户名";
  }
}

// Function to handle page navigation
function goToPage(url) {
  window.location.href = url;
}

// Load the user data when the page is ready
window.onload = loadUserData;
